var path = require('path');


module.exports = {
    entry: [
        path.normalize('es6-shim/es6-shim.min'),
        'reflect-metadata',
        path.normalize('zone.js/dist/zone.min'),
        path.resolve('app/app.ts')
    ],
    output: {
        path: path.resolve('www/build/js'),
        filename: 'app.bundle.js',
        pathinfo: false // show module paths in the bundle, handy for debugging
    },
    devtool: "sourcemap",
    module: {
        loaders: [
            {
                test: /\.ts$/,
                loader: 'awesome-typescript',
                query: {
                    doTypeCheck: true,
                    resolveGlobs: false,
                    externals: ["typings/tsd.d.ts"]
                },
                include: path.resolve('app'),
                exclude: /node_modules/
            },
            {
                test: /\.js$/,
                include: path.resolve('node_modules/angular2'),
                loader: 'strip-sourcemap'
            },
        ],
        noParse: [
            /es6-shim/,
            /reflect-metadata/,
            /zone\.js(\/|\\)dist(\/|\\)zone.min/
        ]
    },
    resolve: {
        alias: {
            'angular2': path.resolve('node_modules/angular2')
        },
        extensions: ['', '.js', '.ts']
    }
};
